from pyproj import Proj
# import numpy as np
# import math

rule = Proj("+proj=tmerc +lat_0=40.04752343063863 +lon_0=116.2872228823074 +k=1 +x_0=0 +y_0=0 +datum=WGS84")

# 经纬度转xy坐标

# longitude = 116.29138484070182
# latitude = 40.05310019003173
# x, y = rule(longitude, latitude)
# print(x, y)

      
# longitude =116.29138484070182
# latitude = 40.05288786638883
# x, y = rule(longitude, latitude)
# print(x, y)
          
# longitude =  116.2916531600855
# latitude = 40.05288786638883
# x, y = rule(longitude, latitude)
# print(x, y)

              
# longitude =116.2916531600855
# latitude = 40.05310019003173
# x, y = rule(longitude, latitude)
# print(x, y)

       
# longitude = 116.29202663166478
# latitude =  40.05300304857326
# x, y = rule(longitude, latitude)
# print(x, y)

longitude = 116.29131625247726
latitude =  40.05336102143821
x, y = rule(longitude, latitude)
print(x, y)
longitude = 116.29078760125634
latitude = 40.052707602118176
x, y = rule(longitude, latitude)
print(x, y)
longitude =116.29137447375416
latitude =   40.05311290465838
x, y = rule(longitude, latitude)
print(x, y)
# x0 = 384.9233527369522
# y0 = -614.8196855630135
# yaw = 142
# l = 0.2
# x = x0 + l * math.cos(yaw * math.pi / 180.0)
# y = y0 + l * math.sin(yaw * math.pi / 180.0)
# print(x, y)

# #xy坐标转经纬度
# x = 369.3125
# y = 626.0625
# x=360.31612
# y= 640.719241
# longitude, latitude = rule(x, y,inverse=True)
# print(longitude, latitude)
# x=353.733519
# y= 638.934429
# longitude, latitude = rule(x, y,inverse=True)
# print(longitude, latitude)
# a = np.zeros((2, 3))
# print(a)